import { stringify } from 'qs';
import request from '@/utils/request';

export async function queryDoclist(params) {
  return request(`/lgjserve/getdoclist?page=${params.currentPage}`, {
    headers: {
      Authorization: sessionStorage.token,
    },
  });
}
export async function queryDocDetail(id) {
  return request(`/lgjserve/getdocdetail/${id}`, {
    headers: {
      Authorization: sessionStorage.token,
    },
  });
}
export async function addDoc(params) {
  return request(`/lgjserve/postDoc`, {
    headers: {
      Authorization: sessionStorage.token,
    },
    method: 'post',
    data: params,
  });
}

export async function updateDoc(params) {
  return request(`/lgjserve/updateDoc`, {
    headers: {
      Authorization: sessionStorage.token,
    },
    method: 'post',
    data: params,
  });
}
export async function deleteDoc(params) {
  return request(`/lgjserve/deleteDoc`, {
    headers: {
      Authorization: sessionStorage.token,
    },
    method: 'post',
    data: params,
  });
}

export async function uploadPhoto(params) {
  return request(`/lgjserve/singleupload`, {
    method: 'post',
    headers: {
      Authorization: sessionStorage.token,
    },
    processData: false,
    data: params,
  });
}
